#Python's built-in modules
Python comes with many built-in modules, called standard library modules, which can be imported and used directly without additional installation.
Module Name | Description | Details |
---|---|---|
string | Common string operations | View |
re | Regular expression operations | View |
difflib | Helpers for computing differences | View |
textwrap | Text wrapping and filling | View |
unicodedata | Unicode database | View |
stringprep | Internet string preparation | View |
readline | GNU readline interface | View |
rlcompleter | Completion function for GNU readline | View |
struct | Interpret bytes as packed binary data | View |
codecs | Codec registry and base classes | View |
datetime | Basic date and time types | View |
zoneinfo | IANA time zone support | View |
calendar | General calendar-related functions | View |
collections | Container datatypes | View |
collections.abc | Abstract base classes for containers | View |
heapq | Heap queue algorithms | View |
bisect | Array bisection algorithms | View |
array | Efficient arrays of numeric values | View |
weakref | Weak references | View |
types | Dynamic type creation and built-in type names | View |
copy | Shallow and deep copy operations | View |
pprint | Pretty-print data | View |
reprlib | Alternative repr() implementation | View |
enum | Support for enumerations | View |
graphlib | Functions for graph-like structures | View |
numbers | Numeric abstract base classes | View |
math | Mathematical functions | View |
cmath | Math functions for complex numbers | View |
decimal | Decimal fixed and floating point arithmetic | View |
fractions | Rational numbers | View |
random | Generate pseudo-random numbers | View |
statistics | Mathematical statistics functions | View |
itertools | Iterator building blocks | View |
operator | Functional interface to operators | View |
pathlib | Object-oriented filesystem paths | View |
os.path | Common pathname manipulations | View |
stat | Interpret results of stat() | View |
filecmp | Compare files and directories | View |
tempfile | Generate temporary files and directories | View |
glob | Unix-style pathname pattern expansion | View |
fnmatch | Unix filename pattern matching | View |
linecache | Random access to text lines | View |
shutil | High-level file operations | View |
pickle | Object serialization | View |
copyreg | Register pickle support functions | View |
shelve | Persistent storage of Python objects | View |
marshal | Internal object serialization | View |
dbm | Unix "database" interface | View |
sqlite3 | SQLite DB-API 2.0 interface | View |
zlib | Gzip-compatible compression | View |
gzip | Support for gzip files | View |
bz2 | Support for bzip2 compression | View |
lzma | Compression using the LZMA algorithm | View |
zipfile | Work with ZIP archives | View |
tarfile | Read and write tar archives | View |
csv | CSV file reading and writing | View |
configparser | Configuration file parser | View |
tomllib | Parse TOML files | View |
netrc | Netrc file handling | View |
plistlib | Parse and create Apple .plist files | View |
hashlib | Secure hashes and message digests | View |
hmac | Keyed-hash message authentication | View |
secrets | Secure random numbers for passwords | View |
os | Miscellaneous operating system interfaces | View |
io | Core tools for working with streams | View |
time | Time access and conversions | View |
logging | Logging facility | View |
logging.config | Logging configuration | View |
logging.handlers | Logging handlers | View |
platform | Platform identification data | View |
errno | Standard errno system symbols | View |
ctypes | Foreign Function Interface | View |
argparse | Command-line option and argument parser | View |
optparse | Parser for command-line options (deprecated) | View |
getpass | Portable password input | View |
fileinput | Iterate over lines from multiple input streams | View |
curses | Terminal handling for character-cell displays | View |
curses.textpad | Text input widget for curses programs | View |
curses.ascii | Tools for ASCII character handling | View |
curses.panel | Panel extension for curses | View |
threading | Thread-based parallelism | View |
multiprocessing | Process-based parallelism | View |
multiprocessing.shared_memory | Shared memory for multiprocessing | View |
concurrent.futures | Launch parallel tasks | View |
subprocess | Subprocess management | View |
sched | Event scheduler | View |
queue | Synchronized queue classes | View |
contextvars | Context variables | View |
_thread | Low-level threading API | View |
asyncio | Asynchronous I/O | View |
socket | Low-level networking interface | View |
ssl | TLS/SSL wrapper for socket objects | View |
select | Wait for I/O completion | View |
selectors | High-level I/O multiplexing | View |
signal | Set asynchronous event handlers | View |
mmap | Memory-mapped file support | View |
Email and MIME handling | View | |
json | JSON encoder and decoder | View |
mailbox | Manipulate various mailbox formats | View |
mimetypes | Map filenames to MIME types | View |
base64 | Base16, Base32, Base64, Base85 encoding | View |
binascii | Convert binary data to/from ASCII | View |
quopri | Encode and decode MIME printable data | View |
html | HTML support | View |
html.parser | Simple HTML and XHTML parser | View |
html.entities | Definitions of HTML general entities | View |
xml.etree.ElementTree | ElementTree XML API | View |
xml.dom | Document Object Model API | View |
xml.dom.minidom | Minimal DOM implementation | View |
xml.dom.pulldom | Support for building partial DOM trees | View |
xml.sax | SAX2 parser support | View |
xml.sax.handler | Base classes for SAX handlers | View |
xml.sax.saxutils | SAX utilities | View |
xml.sax.xmlreader | Interfaces for XML parsers | View |
xml.parsers.expat | Fast XML parsing using Expat | View |
webbrowser | Convenient Web browser control | View |
wsgiref | WSGI utilities and reference implementation | View |
urllib | URL handling modules | View |
urllib.request | Extensible library for opening URLs | View |
urllib.response | Response class used by urllib | View |
urllib.parse | URL parsing | View |
urllib.error | Exceptions raised by urllib.request | View |
urllib.robotparser | robots.txt parser | View |
http | HTTP modules | View |
http.client | HTTP protocol client | View |
ftplib | FTP protocol client | View |
poplib | POP3 protocol client | View |
imaplib | IMAP4 protocol client | View |
smtplib | SMTP protocol client | View |
uuid | UUID objects (RFC 4122) | View |
socketserver | Framework for network servers | View |
http.server | HTTP server | View |
http.cookies | HTTP state management | View |
http.cookiejar | HTTP cookie handling for clients | View |
xmlrpc | XMLRPC client and server modules | View |
xmlrpc.client | XML-RPC client access | View |
xmlrpc.server | Basic XML-RPC server | View |
ipaddress | IPv4/IPv6 manipulation | View |
wave | Read and write WAV files | View |
colorsys | Color system conversions | View |
gettext | Multilingual internationalization services | View |
locale | Internationalization services | View |
turtle | Turtle graphics | View |
cmd | Line-oriented command interpreters | View |
shlex | Simple lexical analysis | View |
tkinter | Python interface to Tcl/Tk | View |
tkinter.colorchooser | Color chooser dialog | View |
tkinter.font | Tkinter font wrapper | View |
tkinter.messagebox | Tkinter message dialogs | View |
tkinter.scrolledtext | Scrolling text widget | View |
tkinter.dnd | Drag and drop support | View |
tkinter.ttk | Themed widgets for Tk | View |
IDLE | Python editor and shell | View |
typing | Type hints support | View |
pydoc | Documentation generator and online help system | View |
doctest | Test interactive Python examples | View |
unittest | Unit testing framework | View |
unittest.mock | Mock object library | View |
test | Python regression test package | View |
test.support | Test suite support tools | View |
test.support.socket_helper | Socket testing tools | View |
test.support.script_helper | Tools for running Python scripts in tests | View |
test.support.bytecode_helper | Tools for testing bytecode generation | View |
test.support.threading_helper | Tools for thread testing | View |
test.support.os_helper | OS testing tools | View |
test.support.import_helper | Import testing tools | View |
test.support.warnings_helper | Warning testing tools | View |
bdb | Debugger framework | View |
faulthandler | Dump Python tracebacks | View |
pdb | Python debugger | View |
timeit | Measure execution time of small code snippets | View |
trace | Trace program execution | View |
tracemalloc | Track memory allocations | View |
ensurepip | Bootstrapping pip installer | View |
venv | Create virtual environments | View |
zipapp | Manage executable Python ZIP archives | View |
sys | System-specific parameters and functions | View |
sys.monitoring | Monitor runtime events | View |
sysconfig | Access Python configuration information | View |
builtins | Built-in objects | View |
main | Top-level script environment | View |
warnings | Warning control | View |
dataclasses | Data classes | View |
contextlib | Context manager utilities | View |
abc | Abstract base classes | View |
atexit | Exit handlers | View |
traceback | Print or retrieve stack traces | View |
future | Future feature definitions | View |
gc | Garbage collector interface | View |
inspect | Inspect live objects | View |
site | Site-specific configuration hook | View |
code | Interpreter base classes | View |
codeop | Compile Python code | View |
zipimport | Import from ZIP archives | View |
pkgutil | Package extension utilities | View |
modulefinder | Find modules used by a script | View |
runpy | Locate and run Python modules | View |
importlib | Implementation of import | View |
importlib.resources | Read/open package resources | View |
importlib.resources.abc | Abstract base classes for resources | View |
importlib.metadata | Access package metadata | View |
ast | Abstract Syntax Trees | View |
symtable | Access compiler symbol tables | View |
token | Constants for tokenizing source code | View |
keyword | Check for Python keywords | View |
tokenize | Tokenizer for Python source code | View |
tabnanny | Detect ambiguous indentation | View |
pyclbr | Class browser support | View |
py_compile | Compile Python source files | View |
compileall | Byte-compile all Python libraries | View |
dis | Disassembler for Python bytecode | View |
pickletools | Developer tools for pickle | View |
msvcrt | Useful routines from MS VC++ runtime | View |
winreg | Windows registry access | View |
winsound | Sound playing interface for Windows | View |
posix | Common POSIX system calls | View |
pwd | Password database | View |
grp | Group database | View |
termios | POSIX-style tty control | View |
tty | Terminal control functions | View |
pty | Pseudo-terminal utilities | View |
fcntl | fcntl and ioctl system calls | View |
resource | Resource usage information | View |
syslog | Unix syslog library routines | View |